<?php

/**
 * @author 
 * @copyright 2009
 */
if($_SESSION['rank'] < 3){
	exit(Lang::getBackGlobal('wrong_permissions'));
}

require_once 'Class.Tools.php';

echo "<h2><img src=\"./components/com_tools/tools.png\" alt=\"Tools\" /> ".Lang::getBackGlobal('tools')."</h2>\n<br />\n";
switch($_GET['action']){
	
	default:
	
	echo '<h3>'.Lang::getBackGlobal('tools_choose').'</h3><br />';
	echo "<table>\n<tr><td><a href=\"".System::$url."index.php?p=tools&amp;action=optimize\">".Lang::getBackGlobal('tools_optimize')."</a></td></tr>\n
	<tr><td><a href=\"".System::$url."index.php?p=tools&amp;action=repair\">".Lang::getBackGlobal('tools_repair')."</a></td></tr>\n
	<tr><td><a href=\"".System::$url."index.php?p=tools&amp;action=size\">".Lang::getBackGlobal('tools_size')."</a></td></tr>\n
	<tr><td><a href=\"".System::$url."index.php?p=tools&amp;action=log_del\">".Lang::getBackGlobal('tools_log')."</a></td></tr>\n
	\n</table>\n
	";
	
	break;
	
	case 'optimize':
	
	echo "\n<table>\n";
	
	Tools::db_optimize();
	Tools::__toString();
	
	echo "\n</table>";
	
	break;
	
	case 'repair':
	
	echo "\n<table>\n";
	
	Tools::db_repair();
	Tools::__toString();
	
	echo "\n</table>";
	
	break;
	
	case 'size':
	
	echo "\n<table>\n";
	
	Tools::db_size();
	Tools::__toString();
	
	echo "\n</table>";
	
	break;
	
	case 'log_del':
	
	echo "\n<table>\n";
	
	Tools::log_truncate();
	Tools::__toString();
	
	echo "\n</table>";
	
	break;
	
}

?>